Skip to content

fix: Fix PHP Warning foreach() argument must be of type array|object, null given#61245

Merged
come-nc merged 1 commit into
masterfrom
fix/fix-php-warning-in-sharehelper
Jun 12, 2026
Merged

fix: Fix PHP Warning foreach() argument must be of type array|object, null given#61245
come-nc merged 1 commit into
masterfrom
fix/fix-php-warning-in-sharehelper

Conversation

@come-nc

@come-nc come-nc commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

… null given

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added this to the Nextcloud 35 milestone Jun 12, 2026
@come-nc come-nc requested a review from a team as a code owner June 12, 2026 12:31
@come-nc come-nc requested review from Altahrim, ArtificialOwl and leftybournes and removed request for a team June 12, 2026 12:31
@come-nc come-nc added the 2. developing Work in progress label Jun 12, 2026
@come-nc

come-nc commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 12, 2026
$item = $item->getParent();

if ($byId[$item->getId()] !== []) {
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {
if (isset($byId[$item->getId()])) {

Should be enough I think (and more consistent with existing logic above)

while (!empty($byId)) {
try {
if ($byId[$item->getId()] !== []) {
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {
if (isset($byId[$item->getId()])) {

Same.

@come-nc come-nc enabled auto-merge June 12, 2026 16:27
@come-nc come-nc merged commit 1ac195d into master Jun 12, 2026
246 of 279 checks passed
@come-nc come-nc deleted the fix/fix-php-warning-in-sharehelper branch June 12, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants